//
//  SWRefreshStateBarView.swift
//  SinaWeibo
//
//  Created by wszyxc on 16/7/26.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

import UIKit

class SWRefreshStateBarView: UIView {

    
    var stateStr:String?{
        
        didSet{
       
            stateLabel.text = stateStr
            
        }
        
    }
    

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //设置控件
    
    private func setupUI(){
        
        addSubview(stateLabel)
        
        stateLabel.textAlignment = .Center
        
        stateLabel.backgroundColor = THEMECOLOR
        
        //设置约束
        
        stateLabel.snp_makeConstraints { (make) -> Void in
            
            make.edges.equalTo(UIEdgeInsetsZero)
        
        }
        
        self.hidden = true
    }
    
    //懒加载label
    lazy var stateLabel:UILabel = UILabel(textColor: UIColor.whiteColor(), fontSize: 16)
    

}
